package com.pfizer.Entity;

import java.util.Date;

/**
 * Handout--<b>文章信息實體</b>--
 * 靜態變量為創建數據庫表所需字段名
 * @author krui
 * @version 1.45 2011/11/20
 *
 */

public class Handout{

	public static final String 		HANDOUTSTRING="Handout";
	public static final String 		HANDOUTIDSTRING="Handout_ID";
	public static final String 		HANDOUTICONSTRING="Icon";
	public static final String 		HANDOUTSUBJSTRING="Subj";
	public static final String 		HANDOUTFESTRING="Filename_Extension";
	public static final String 		HANDOUTPICCNTSTRING="Pic_Cnt";
	public static final String 		HANDOUTDLPICCNTSTRING="DlPic_Cnt";
	public static final String		HANDOUTCLASSSTRING="HandoutClass";
	public static final String 		HANDOUTQNSTRING="Questionnaire";
	public static final String		HANDOUTLUTIMESTRING="Last_Upd_Time";
	public static final String		HANDOUTURLPATHSTRING="Url_Path";
	private long		Handout_ID=0;
	private String		Handout_Icon="";
	private String 	Handout_Subj="";
	private int	 		Pic_Cnt;
	private String 	Filename_Extension="";
	private String		HandoutClass;
	private long	 	Questionnaire=-1;
	private long		Last_Upd_Time;
	private int			Download_Pic_Cnt=0;
	private Date		dt;
	private String		UrlPath="";
	public Handout(long _ID,String _Subj,String _Desc,int _Pic_Cnt,String _Filename_Extension,String  _Class,long _Questionnaire,String _LstTime,int _Dl_Pic_Cnt)
	{
		this.Handout_ID=_ID;
		this.Handout_Subj=_Subj;
		this.Pic_Cnt=_Pic_Cnt;
		this.Filename_Extension=_Filename_Extension;
		this.HandoutClass=_Class;
		this.Questionnaire=_Questionnaire;
		dt=new Date(_LstTime);
		this.Last_Upd_Time=dt.getTime()/1000;
		this.Download_Pic_Cnt=_Dl_Pic_Cnt;
	}
	public Handout()
	{
		
	}
	public Handout(String _ID)
	{
		this.Handout_ID=new Long(_ID).intValue();
	}
	public void setID(String _ID)
	{
		this.Handout_ID=new Long(_ID).intValue();
	}
	public void setID(long _ID)
	{
		this.Handout_ID=_ID;
	}
	public long getID()
	{
		return this.Handout_ID;
	}
	public void setIcon(String _Icon)
	{
		this.Handout_Icon=_Icon;
	}
	public String getIcon()
	{
		return this.Handout_Icon;
	}
	public void setSubj(String _Subj)
	{
		this.Handout_Subj=_Subj;
	}
	public String getSubj()
	{
		return this.Handout_Subj;
	}
	public void setPicCnt(int _Pic_Cnt)
	{
		this.Pic_Cnt=_Pic_Cnt;
	}
	public int getPicCnt()
	{
		return this.Pic_Cnt;
	}
	public void setFilenameExtension(String _FilenameExtension)
	{
		this.Filename_Extension=_FilenameExtension;
	}
	public String getFilenameExtension()
	{
		return this.Filename_Extension;
	}
	public void setHandoutClass(String  _Class)
	{
		this.HandoutClass=_Class;
	}
	public String getHandoutClass()
	{
		return this.HandoutClass;
	}
	public void setQuestionnaire(String _Questionnaire)
	{
		if(_Questionnaire==null||_Questionnaire.length()==0)
		{
			this.Questionnaire=-1;
		}
		else
		{
			this.Questionnaire=new Long(_Questionnaire).intValue();
		}
	}
	public void setQuestionnaire(long _Questionnaire)
	{
		this.Questionnaire=new Long(_Questionnaire).intValue();
	}
	public long getQuestionnaire()
	{
		return this.Questionnaire;
	}
	public void setLstUpdTime(String _LstUpdTime)
	{
		if(_LstUpdTime.length()==0)
		{
			this.Last_Upd_Time=0;
			return;
		}
		dt=new Date(_LstUpdTime);
		this.Last_Upd_Time=dt.getTime()/1000;
	}
	public void setLstUpdTime(long _LstUpdTime)
	{
		this.Last_Upd_Time=_LstUpdTime;
	}
	public long getLstUpdTime()
	{
		return this.Last_Upd_Time;
	}
	public void setDlPicCnt(int _Dl_Pic_Cnt)
	{
		this.Download_Pic_Cnt=_Dl_Pic_Cnt;
	}
	public int getDlPicCnt()
	{
		return this.Download_Pic_Cnt;
	}
	public void setUrlPath(String _path)
	{
		this.UrlPath=_path;
	}
	public String getUrlPath()
	{
		return this.UrlPath;
	}
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return String.valueOf(this.Handout_ID)+",name  "+this.Handout_Subj+"\n";
	}
}
